﻿@using NC.Infrastructure.DomainDto
@model NC.Cather.UrlList
@if (Model != null)
{
    @Html.HiddenFor(model => model.Id);
}

<input type="hidden" name="targetId" value="@(Request.QueryString["targetId"])" />
<div class="form-group">
    <label class="control-label col-md-2">列表地址</label>
    <div class="col-md-10">
        <input type="text" class="form-control" name="Url" id="Url" value="@(Model==null?"":Model.Url)" onblur="checkUrlIsValide()" />
        @Html.ValidationMessageFor(model => model.Url, "", new { @class = "text-danger" })
    </div>
</div>

<div class="form-group">
    <label class="control-label col-md-2">名称</label>
    <div class="col-md-10">
        @Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = "form-control" } })
        @Html.ValidationMessageFor(model => model.Name, "", new { @class = "text-danger" })
    </div>
</div>

<div class="form-group">
    <label class="control-label col-md-2">容器获取http方式</label>
    <div class="col-md-10">
        @{
            //get:true  post:false
            bool check = Model == null || Model.Method.ToLower() == "get";
            if (check)
            {
                <input type="radio" value="get" name="Method" checked="checked" /><span>GET</span>
                <input type="radio" name="Method" value="post" /><span>POST</span>
            }
            else
            {
                <input type="radio" value="get" name="Method" /><span>GET</span>
                <input type="radio" name="Method" value="post"  checked="checked" /><span>POST</span>
            }
        }
    </div>
</div>
<div class="form-group">
    <label class="control-label col-md-2">容器选择器</label>
    <div class="col-md-10">

        <div class="input-group">
            <input type="text" class="form-control" name="ContentSelector" id="ContentSelector" value="@(Model==null?"":Model.ContentSelector)" />
            <div class="input-group-btn">
                <div class="btn btn-primary" onclick="ContentSelectorTest()">测试</div>
            </div>
        </div>
    </div>
</div>

<div class="form-group">
    <label class="control-label col-md-2">a标签选择器</label>
    <div class="col-md-10">
        <div class="input-group">
            <input type="text" class="form-control" name="ASelector" id="ASelector" value="@(Model==null?"":Model.ASelector)" />
            <div class="input-group-btn">
                <div class="btn btn-primary" onclick="ASelectorTest()">测试</div>
            </div>
        </div>
    </div>
</div>

@{
    bool enablePager = Model == null ? false : Model.EnablePager;
}
<div class="form-group">
    <label class="control-label col-md-2">是否开启分页</label>
    <div class="col-md-10">
        @if (enablePager)
        {
            <input type="checkbox" value="0" name="EnablePager" id="EnablePager" checked="checked" onclick="pagerChange()" />
        }
        else
        {
            <input type="checkbox" value="0" name="EnablePager" id="EnablePager" onclick="pagerChange()" />
        }
    </div>
</div>

<div class="form-group pager-show">
    <label class="control-label col-md-2">QueryString参数</label>
    <div class="col-md-10">
        <input type="text" class="form-control" name="QueryStringParams" id="QueryStringParams" onblur="checkQueryIsValid()" value="@(Model==null?"":Model.QueryStringParams)" />
    </div>
</div>

<div class="form-group pager-show">
    <label class="control-label col-md-2">PostBody参数</label>
    <div class="col-md-10">
        <div class="input-group">
            <input type="text" class="form-control" name="PostBodyParams" id="PostBodyParams" onblur="checkPostBodyIsValid()" value="@(Model==null?"":Model.PostBodyParams)" />
            <div class="input-group-btn">
                <div class="btn btn-primary" onclick="PagerSelectorTest()">测试</div>
            </div>
        </div>
    </div>
</div>


<div class="form-group pager-show">
    <label class="control-label col-md-2">分页模板</label>
    <div class="col-md-10">
        <div class="input-group">
            <input type="text" class="form-control" name="PagerSelector" id="PagerSelector" onblur="checkPagerIsValid()" value="@(Model==null?"":Model.PagerSelector)" />
            <div class="input-group-btn">
                <div class="btn btn-primary" onclick="PagerSelectorTest()">测试</div>
            </div>
        </div>
    </div>
</div>

<div class="form-group pager-show">
    <label class="control-label col-md-2">分页数量</label>
    <div class="col-md-10">
        <input type="number" class="form-control" name="PerRequestPagerNum" id="PerRequestPagerNum" value="@(Model==null?"":Model.PerRequestPagerNum)" />
    </div>
</div>



